math.randomseed(os.time())

local skynet = require "skynet"
local MessageType = require "common.message_type"

skynet.start(function()

    local watchdog = skynet.newservice("watchdog")
    local agents = skynet.newservice("agents")
    local match = skynet.newservice("match")
    local race = skynet.newservice("race")

    skynet.call(watchdog,"lua",MessageType.Inited,agents)
    skynet.call(agents,"lua",MessageType.Inited,watchdog)
    skynet.call(match,"lua",MessageType.Inited,agents)

    skynet.call(watchdog, "lua", "start" , {
        port = tonumber(skynet.getenv  "watchdog_port") or 9999,
        maxclient = 4096,
        servername = "simple-lock-step-server",
    })
end)